# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=proxybroker2
pkgver=552.b7f340a
pkgrel=1
pkgdesc='Proxy [Finder | Checker | Server]. HTTP(S) & SOCKS.'
groups=('blackarch' 'blackarch-proxy' 'blackarch-scanner')
arch=('any')
url='https://github.com/bluet/proxybroker2'
license=('Apache')
depends=('python' 'python-aiohttp' 'python-aiodns' 'python-attrs'
         'python-maxminddb' 'python-cachetools')
makedepends=('git' 'python-setuptools' 'python-wheel' 'python-pip')
replaces=('proxybroker')
source=("git+https://github.com/bluet/$pkgname")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's|attrs==19.3.0|attrs|g' setup.py
  sed -i 's|cachetools==4.1.0|cachetools|g' setup.py
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr -O1

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" *.md
}

